import Vue from 'vue'
import Router from 'vue-router'



const index = () => import('@/components/index')
const login = () => import('@/components/login')
const home = () => import('@/components/home')
const babyInfo = () => import('@/components/babyInfo')
const myStudy = () => import('@/components/myStudy')
const personCenter = () => import('@/components/personCenter')
const studyPageClass = () => import('@/components/studyPageClass')
const studyPageSignIn = () => import('@/components/studyPageSignIn')
const taskDetail = () => import('@/components/taskDetail')
const clockIn = () => import('@/components/clockIn')
import test from '@/components/test'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/babyInfo',
      name: 'babyInfo',
      component: babyInfo
    },
    {
      path: '/clockIn',
      name: 'clockIn',
      component: clockIn
    },
    
    {
      path: '/home',
      name: 'index',
      component: index,
      children: [
        {
          path: '/test/',
          name: 'test',
          component: test
        },
        {
          path: '/myStudy/:openId',
          name: 'myStudy',
          component: myStudy
        },
        {
          path: '/personCenter/:openId',
          name: 'personCenter',
          component: personCenter
        },
        {
          path: '/studyPageClass/:openId/:subjectId/',
          name: 'studyPageClass',
          component: studyPageClass
        },
        {
          path: '/studyPageSignIn',
          name: 'studyPageSignIn',
          component: studyPageSignIn
        },
        {
          path: '/taskDetail/:openId',
          name: 'taskDetail',
          component: taskDetail,
          meta: {
            level: 2,
          }
        },
        
      ]
    },
    
    
    
  ]
})
